import Vue from 'vue/dist/vue.js'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'
Vue.use(VueRouter)
const routes = [];

const files = import.meta.globEager('../views/**/router.config.js');
for (const key in files) {
  const element = files[key];
  routes.push(element.router);
}

// 添加路由默认跳转页面
routes.push({
  path: '/',
  redirect: '/main'
});

// 生成路由
// 如有需要添加 全局路由导航守卫功能, 可添加在此处
const router = new VueRouter({
  routes
})

export default router
